From 7b8e0b8bc82595191cb1e5c5312c1e0c2622944f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 25 May 2005 14:02:21 +0000 Subject: [PATCH] Make sure png comes first, otherwise dnd may use bmp by default, loosing 2005-05-25 Matthias Clasen * gtk/gtkselection.c (gtk_target_list_add_image_targets): Make sure png comes first, otherwise dnd may use bmp by default, loosing transparency. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkselection.c | 15 +++++++++++++++ 4 files changed, 33 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3b16a5bbbe..4ebb9bcba6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-05-25 Matthias Clasen + + * gtk/gtkselection.c (gtk_target_list_add_image_targets): + Make sure png comes first, otherwise dnd may use bmp by + default, loosing transparency. + 2005-05-25 Michael Natterer * gtk/gtktextview.c (blink_cb): block the text_layout's "changed" diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 3b16a5bbbe..4ebb9bcba6 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2005-05-25 Matthias Clasen + + * gtk/gtkselection.c (gtk_target_list_add_image_targets): + Make sure png comes first, otherwise dnd may use bmp by + default, loosing transparency. + 2005-05-25 Michael Natterer * gtk/gtktextview.c (blink_cb): block the text_layout's "changed" diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 3b16a5bbbe..4ebb9bcba6 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2005-05-25 Matthias Clasen + + * gtk/gtkselection.c (gtk_target_list_add_image_targets): + Make sure png comes first, otherwise dnd may use bmp by + default, loosing transparency. + 2005-05-25 Michael Natterer * gtk/gtktextview.c (blink_cb): block the text_layout's "changed" diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index 0318e75c29..1c04c3f241 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -362,6 +362,21 @@ gtk_target_list_add_image_targets (GtkTargetList *list, formats = gdk_pixbuf_get_formats (); + /* Make sure png comes first */ + for (f = formats; f; f = f->next) + { + GdkPixbufFormat *fmt = f->data; + + if (strcmp (gdk_pixbuf_format_get_name (fmt), "png") == 0) + { + formats = g_slist_delete_link (formats, f); + formats = g_slist_prepend (formats, fmt); + + break; + } + + } + for (f = formats; f; f = f->next) { GdkPixbufFormat *fmt = f->data; -- 2.30.2